﻿Imports DTO
Imports DAO
Imports BUS
Imports System.Data.OleDb
Public Class Phieudangkykhambenh
    Private _HoTen As String
    Public Property HoTen() As String
        Get
            Return _HoTen
        End Get
        Set(ByVal value As String)
            _HoTen = value
        End Set
    End Property
    Private _NgayKham As Date
    Public Property NgayKham() As Date
        Get
            Return _NgayKham
        End Get
        Set(ByVal value As Date)
            _NgayKham = value
        End Set
    End Property
    Private _GioiTinh As String
    Public Property GioiTinh() As String
        Get
            Return _GioiTinh
        End Get
        Set(ByVal value As String)
            _GioiTinh = value
        End Set
    End Property

    Private Sub btnthoat_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnthoat.Click
        Close()
    End Sub

    Private Sub Phieudangkykhambenh_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        dtp_ngaykham.Value = Date.Now()

    End Sub

    Private Sub btndangky_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btndangky.Click
        Dim cnDTO As New KhamBenhDTO()

        cnDTO.DiaChi = txt_diachi.Text
        cnDTO.HoTen = txt_hoten.Text
        cnDTO.GioiTinh = cbb_gioitinh.Text
        cnDTO.NgayKham = dtp_ngaykham.Value
        cnDTO.NamSinh = dtp_namsinh.Value
        Dim kq As Integer
        Dim bus As New KhamBenhBUS()
        kq = bus.Themphieudangkykhambenh(cnDTO)
        If kq = 1 Then
            MessageBox.Show("Them Thanh Cong")
        Else
            MessageBox.Show("Them That Bai")
        End If
        _HoTen = txt_hoten.Text
        _NgayKham = dtp_ngaykham.Value
        Dim f As New PhieuKhamBenh()
        f.Label2.Text = dtp_ngaykham.Value.ToString()
        f.ShowDialog()
    End Sub

    Private Sub cbb_gioitinh_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cbb_gioitinh.SelectedIndexChanged
        'cbb_gioitinh.DisplayMember =
    End Sub
End Class